package com.iakuil.app.domain.entity;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.iakuil.app.common.core.annotation.Unique;
import com.iakuil.app.common.core.domain.BaseEntity;
import com.iakuil.app.common.core.enums.Gender;
import lombok.*;

/**
 * 用户实体类
 *
 * @author Kai
 * @date 2024-01-26
 **/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_user")
public class User extends BaseEntity {

    /**
     * 用户账号
     */
    @Unique("用户名重复")
    private String userName;

    /**
     * 用户昵称
     */
    private String nickName;

    /**
     * 用户邮箱
     */
    @Unique("Email重复")
    private String email;

    /**
     * 手机号码
     */
    @Unique("手机号码重复")
    private String phoneNumber;

    /**
     * 性别
     */
    private Gender gender;

    /**
     * 密码
     */
    private String password;

    /**
     * NULL：未删除 其他：已删除
     */
    @TableLogic(value = "NULL", delval = "NOW()")
    private Long deleted;

    /**
     * 乐观锁版本号
     */
    @Version
    private Long version;
}
